import request from '@/utils/request'

const base_url="http://127.0.0.1:8083/oauthDemo"

export function deleteUser(params){
  return request({
    url:base_url+"/user/delete",
    method:"get",
    params
  })
}

export function saveOrUpdate(params) {
  return request({
    // headers: { 'content-type': 'application/x-www-form-urlencoded' },
    // headers: { 'content-type': 'application/json' },
    url:base_url+"/user/saveOrUpdate",
    method:"post",
    params
  })
}

export function queryUser(params) {
  return request({
    url:base_url+"/user/list",
    method:"get",
    params
  })
}

export function login(data) {
  return request({
    // url: '/vue-admin-template/user/login',
    url: base_url+'/dologin',
    method: 'post',
    data
  })
}
export function register(data) {
  return request({
    url: base_url+'/user/register',
    method: 'post',
    data
  })
}


export function getInfo(token) {
  return request({
    // url: '/vue-admin-template/user/info',
    url: base_url+'/user/info',
    method: 'get',
    params: { token }
  })
}

export function logout() {
  return request({
    // url: '/vue-admin-template/user/logout',
    url: base_url+'/logout',
    method: 'post'
  })
}
